import java.util.Scanner;

/**
 * @author zhaoqian
 * @create 2021/8/30 15:21
 */
public class Stringnum {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            String str = in.nextLine();
            System.out.println(test(str));
        }
    }
    private static String test(String str){
        int zimu=0;
        int num=0;
        int els=0;
        int nbsp=0;
        for (int i=0;i<str.length();i++){
            char c = str.charAt(i);
            int d =(int)c;
            if (d>=65&&d<=90||d>=97&&d<=122){
                zimu++;
            }
            else if (d>=48&&d<=57){
                num++;
            }else if (d==32){
                nbsp++;
            }

            else {
                els++;
            }
        }
        System.out.println(zimu);
        System.out.println(nbsp);
        System.out.println(num);
        System.out.println(els);
        return "";
    }
}
